<?php
namespace app\admin\model;

use think\Model;
use \think\Session;
use think\Db;
use traits\model\SoftDelete;


/**
* 文章分类管理
*/
class ArticleCategorys extends \think\Model
{
    use SoftDelete;
    protected $table = 'article_categorys';
    protected $autoWriteTimestamp = 'timestamp';
    protected $createTime = 'created_at';
    protected $updateTime = 'updated_at';
    protected $deleteTime = 'deleted_at';

    /**
     * 创建新的文章分类
     */
    public function createArticleCategory($category_info)
    {
        return $this->create($category_info);
    }

    /**
     * 获取文章分类列表
     */
    public function getAarticleCategoryList($page,$limit)
    {
        return $this->withTrashed()->page($page,$limit)->select();
    }

    /**
     * 修改文章分类列表
     */
    public function updateCategoryInfo($id,$update_info)
    {
        return $this->update($update_info,['id'=>$id]);
    }

    /**
     * 软删除文章
     */
    public function del($id)
    {
        return $this->where('id',$id)->delete();
    }
    
   


    
}